# list 数据结构的处理
classmates = ['Michael', 'Bob', 'Tracy']
print(classmates)
print(len(classmates))
print(classmates[2])
print(classmates[-1])
classmates.append('Adam')
print(classmates)
classmates.insert(1, 'Jack')
print(classmates)
#要删除list末尾的元素，用pop()方法：
classmates.pop(1)
print(classmates)


# tuple 数据结构的处理
classmates = ('Michael', 'Bob', 'Tracy')
print(classmates)
t = ('a', 'b', ['A', 'B'])
print(t)
t[2][0] = 'X'
t[2][1] = 'Y'
print(t)

# 对数处理是否也可以跟tuple一样呢
L = [
    ['Apple', 'Google', 'Microsoft'],
    ['Java', 'Python', 'Ruby', 'PHP'],
    ['Adam', 'Bart', 'Lisa']
]
print(L)
print(L[0][1])